<%@ page import="org.codehaus.groovy.grails.web.servlet.GrailsApplicationAttributes" %>
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title><g:layoutTitle default="${meta(name: 'app.name')}"/></title>
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="viewport" content="initial-scale = 1.0">
    <script src="js/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
    
  <r:require modules="scaffolding"/>

  <g:layoutHead/>
  <r:layoutResources/>
</head>

<body>
  <nav class="navbar navbar-fixed-top">
    <div class="navbar-inner">
      <div class="container">					
        <a class="brand" href="${createLink(uri: '/')}">Domesti-K</a>
        <div class="nav-collapse" style="height: auto;">
          <ul class="nav">							
            <li<%= request.forwardURI == "${createLink(uri: '/')}" ? ' class="active"' : '' %>><a href="${createLink(uri: '/')}">Home</a></li>
            <li<%= controllerName == "acerca" ? ' class="active" ':''%>><a href="/IS2_Domestik/Acerca">Acerca de</a></li>
            <li<%= controllerName == "link" ? ' class="active" ':''%>><a href="/IS2_Domestik/link">Contacto</a></li>
            <li<%= controllerName == "usuario" && actionName=="trabajadoresPorProfesion" ? ' class="active" ':''%>><a href="/IS2_Domestik/Usuario/trabajadoresPorProfesion">Buscar trabajadores</a></li>
            <sec:ifNotLoggedIn>
              <li<%= controllerName == "usuario" && actionName=="create" ? ' class="active" ':''%>><a href="/IS2_Domestik/Usuario/create">Regístrate</a></li>
              <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#menu1">Login<b class="caret"></b></a>
                <div class="dropdown-menu">
                  <form style="margin: 0px" accept-charset="UTF-8" action="${resource(file: 'j_spring_security_check')}" method='POST'>
                    <div style="margin:0;padding:0;display:inline">
                      <input name="utf8" type="hidden" value="&#x2713;" />
                      <input name="authenticity_token" type="hidden" value="4L/A2ZMYkhTD3IiNDMTuB/fhPRvyCNGEsaZocUUpw40=" />
                    </div>
                    <fieldset class='textbox' style="padding:10px">
                      <input style="margin-top: 8px" type="text" placeholder="Nombre de Usuario" name='j_username' id='username' />
                      <input style="margin-top: 8px" type="password" placeholder="Contraseña" name='j_password' id='password' />
                      <input class="btn-primary" name="commit" type="submit" value="Log In" />
                    </fieldset>
                  </form>
                </div>
              </li>
            </sec:ifNotLoggedIn>
            <sec:ifLoggedIn>	

              <sec:ifAllGranted roles="ROLE_USER">
                <li<%= controllerName == "usuario" ? ' class="active" ':''%>><a href="/IS2_Domestik/Usuario/PerfilUsuario">Ver Mi Perfil</a></li>
              </sec:ifAllGranted>	
              <sec:ifAllGranted roles="ROLE_ADMIN">
                <li<%= controllerName == "administrador" && actionName=="perfilAdministrador" ? ' class="active" ':''%>><a href="/IS2_Domestik/Administrador/PerfilAdministrador">Ver Mi Perfil</a></li>
                <li<%= controllerName == "administrador" && actionName=="list"? ' class="active" ':''%>><a href="/IS2_Domestik/Administrador/list">Administrar Administradores</a></li>
                <li<%= controllerName == "usuario" ? ' class="active" ':''%>><a href="/IS2_Domestik/Usuario/list">Administrar Usuarios</a></li>
              </sec:ifAllGranted>
              <li<%= controllerName == "logout" ? ' class="active" ':''%>><a href="/IS2_Domestik/Logout">Logout</a></li>
            </sec:ifLoggedIn>
          </ul>				
        </div>					
      </div>
    </div>
  </nav>
  <div class="container">
    <g:layoutBody/>

    <hr>

    <footer>
      <p>&copy; Domesti-K 2012</p>
    </footer>
  </div>

<r:layoutResources/>

</body>
</html>